﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorldConqueror.Libraries.Maths.MathShapes;

namespace WorldConqueror.Libraries.Maths.Functions.Area
{
    public abstract class MathShapeArea<Type1> : IOneParameterFunction<Type1, double>
        where Type1 : IMathShape
    {
        public MathShapeArea(Type1 parameter1)
        {
            MathShape = parameter1;
        }

        public virtual Type1 MathShape { get; protected set; }

        public double Calculate()
        {
            MathShape.Area = CalculateBase();

            return MathShape.Area;
        }

        public abstract double CalculateBase();
    }
}
